let map = {
  // 全局上只是放置一个数据库
  partyDb: undefined,
  // partyDn 下的 intent 集
  intentCl: undefined,
  userInfoCl: undefined,
  momentsCl: undefined,
};

const createSetter = name => {
  return val => {
    if ( !map[name] ){
      map[name] = val;
    }
  }
};

const createGetter = name => () => map[name];

const createMan = name => {
  return {
    set: createSetter(name),
    get: createGetter(name)
  }
};


module.exports = {
  partyM: createMan('partyDb'),
  intentM: createMan('intentCl'),
  userInfoM: createMan('userInfoCl'),
  momentsM: createMan('momentsCl')
};